import db from "@/lib/db";
import UserInfo from "@/components/page/user-info";
import {EditUser} from "@/lib/zod/types";

export default async function Page({params}: { params: Promise<{ userId: string }> }) {
    const {userId} = await params;
    const user = await db.users.findUnique({where: {userId: parseInt(userId)}});
    const editUser = user as EditUser;

    return (
        <>
            <UserInfo mode={"edit"} userInfo={editUser} successTargetUrl={"/home/user"}/>
        </>
    );
}
